/**
 * User: alesj
 * Date: 10.1.2006
 * Time: 18:20:54
 * 
 * (C) Genera Lynx d.o.o.
 */

package com.alesj.blueberry.sar.smpp.impl;

import com.alesj.blueberry.sar.notify.Notifyer;
import com.alesj.blueberry.sar.smpp.SMPPService;
import ie.omk.smpp.Connection;
import org.jboss.system.ServiceMBeanSupport;

/**
 * Abstract smpp service object.
 * Hides the unnecessary properties / methods.
 *
 * @author <a href="mailto:ales.justin@genera-lynx.com">Ales Justin</a>
 *
 * @jmx.mbean
 * @jboss.xmbean
 */
public abstract class AbstractSMPPService extends ServiceMBeanSupport implements SMPPService {

    private String host;
    private int port;
    private boolean asynchronous;
    private Integer version;
    private Notifyer[] notifyers;
    private String systemId = "blueberrySysId";
    private String password;
    private String systemType;
    private int reconnectTries = 10;
    private long reconnectSleep = 30000; //30s
    private long unboundTimeout = 30000; //30s

    private Connection connection;

    public Connection getConnection() {
        return connection;
    }

    protected void setConnection(Connection connection) {
        this.connection = connection;
    }

    /**
     * @jmx.managed-attribute
     */
    public String getHost() {
        return host;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setHost(String host) {
        this.host = host;
    }

    /**
     * @jmx.managed-attribute
     */
    public int getPort() {
        return port;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setPort(int port) {
        this.port = port;
    }

    /**
     * @jmx.managed-attribute
     */
    public boolean isAsynchronous() {
        return asynchronous;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setAsynchronous(boolean asynchronous) {
        this.asynchronous = asynchronous;
    }

    /**
     * @jmx.managed-attribute
     */
    public Integer getVersion() {
        return version;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setVersion(Integer version) {
        this.version = version;
    }

    public Notifyer[] getNotifyers() {
        return notifyers;
    }

    public void setNotifyers(Notifyer[] notifyers) {
        this.notifyers = notifyers;
    }

    /**
     * @jmx.managed-attribute
     */
    public String getSystemId() {
        return systemId;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setSystemId(String systemId) {
        this.systemId = systemId;
    }

    /**
     * @jmx.managed-attribute
     */
    public String getPassword() {
        return password;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setPassword(String password) {
        this.password = password;
    }

    /**
     * @jmx.managed-attribute
     */
    public String getSystemType() {
        return systemType;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setSystemType(String systemType) {
        this.systemType = systemType;
    }

    /**
     * @jmx.managed-attribute
     */
    public int getReconnectTries() {
        return reconnectTries;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setReconnectTries(int reconnectTries) {
        this.reconnectTries = reconnectTries;
    }

    /**
     * @jmx.managed-attribute
     */
    public long getReconnectSleep() {
        return reconnectSleep;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setReconnectSleep(long reconnectSleep) {
        this.reconnectSleep = reconnectSleep;
    }

    /**
     * @jmx.managed-attribute
     */
    public long getUnboundTimeout() {
        return unboundTimeout;
    }

    /**
     * @jmx.managed-attribute
     */
    public void setUnboundTimeout(long unboundTimeout) {
        this.unboundTimeout = unboundTimeout;
    }

}
